﻿// JScript File

var Sys = {};
        var ua = navigator.userAgent.toLowerCase();
        if (window.ActiveXObject)
            Sys.ie = ua.match(/msie ([\d.]+)/)[1]
        else if (document.getBoxObjectFor)
            Sys.firefox = ua.match(/firefox\/([\d.]+)/)[1]
        else if (window.MessageEvent && !document.getBoxObjectFor)
            Sys.chrome = ua.match(/chrome\/([\d.]+)/)[1]
        else if (window.opera)
            Sys.opera = ua.match(/opera.([\d.]+)/)[1]
        else if (window.openDatabase)
            Sys.safari = ua.match(/version\/([\d.]+)/)[1];

var TabEvent = {

Test:"test",
_this:this,
className:"",

MouseOver:function(name){

alert("over "+name);
},
MouseOut:function(e){
alert("out "+e.className);
},

AddEvent:function(){

 var tabItems = document.getElementsByTagName("span");
      
      var className = "";
      for(var i = 0; i < tabItems.length;i++)
      {
         className = tabItems[i].className;
         this.className = className;
         //find tab span
         if(className.indexOf("Tab") != -1)
         {
         
         
         if(Sys.ie){
         
         tabItems[i].attachEvent("onmouseover",function(){
           alert(this.className);
           this.MoutOver(className);
         
         });
         //tabItems[i].attachEvent("onmouseout",this.MouseOut);
         
         
         }else
         {
         
         tabItems[i].addEventListener("mouseover",this.MouseOver,false);
         tabItems[i].addEventListener("mouseout",this.MouseOut,false);
         
         }
         

           
         
         }
         
         
      }
}

};
            


window.onload = function(){

     TabEvent.AddEvent();
};


var Title = {

titleId:"Title",

timerId:null,

ShowCartown:function(){    

    
    var o = document.getElementById(this.titleId);
    var top = o.offsetTop;
    top = top + 1;
    o.style.top = top + "px";
  
    
    if(top == 0){
    clearTimeout(this.timerId);
    }
    
    
    this.timerId = setTimeout(this.ShowCartown(),1000); 
}

};
